<template>

    <div>
        <el-dialog title="收货地址" :visible.sync="dialogFormVisible" :show-close="false">
            <el-form :model="form">
                <el-form-item label="用户名" :label-width="formLabelWidth">
                <el-input v-model="form.name" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="密码" :label-width="formLabelWidth">
                <el-input v-model="form.passwd" autocomplete="off"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="login()">登录</el-button>
            </div>
        </el-dialog>
    </div>

</template>

<script>
    export default {
        data(){
            return{
                dialogFormVisible: true,
                formLabelWidth: '120px',
                form:{
                    name:'',
                    passwd:''
                }
            }
        },
        methods:{
            login(){
                this.axios.get('',{
                    params:{
                        u:this.form.name,
                        p:this.form.passwd
                    }
                })
                .then(res=>{
                    console.log(res);
                    this.dialogFormVisible=false
                    this.$router.push("/index")
                })
                .catch(error=>{
                    alert(error)
                })
            }
        }

    }
</script>

<style scoped>

</style>